﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Helper_Ji
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
        }

        Helper_Fetion fetion;
        void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            fetion = new Helper_Fetion("15824806050", "jiailiuyan1314");
            fetion.OnResiving += new EventHandler<Helper_Fetion.SMSMessageEventArgs>(fetion_OnResiving);
        }

        void fetion_OnResiving(object sender, Helper_Fetion.SMSMessageEventArgs e)
        {
            this.Dispatcher.Invoke((Action)(()=>{
                textBox1.Text = e.Message;
            }));
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {

           
        }

        private void button2_Click(object sender, RoutedEventArgs e)
        {
           
        }

        private void button3_Click(object sender, RoutedEventArgs e)
        {
         
        }

    }
}
